/* components/modal/modal.less */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9999;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.modal-overlay.show {
  opacity: 1;
  visibility: visible;
}

.modal-container {
  background: #fff;
  border-radius: 0;
  width: 100%;
  max-height: 70vh;
  overflow: hidden;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.15);
  position: relative;
}

.modal-overlay.show .modal-container {
  transform: translateY(0);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 20px 16px;
  border-bottom: 1px solid #f5f5f5;
  background: #fff;
  color: #333;
  position: relative;
}

.modal-title {
  font-size: 18px;
  font-weight: 600;
  flex: 1;
  margin-right: 16px;
  color: #1a1a1a;
  line-height: 1.3;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.modal-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #f8f9fa;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid #e9ecef;
}

.modal-close:active {
  background: #e9ecef;
  transform: scale(0.95);
}

.close-icon {
  font-size: 18px;
  color: #6c757d;
  font-weight: 400;
}

.modal-content {
  padding: 16px 20px;
  max-height: 55vh;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

/* 详情内容区域 */
.detail-content {
  margin-top: 16px;
  width: 100%;
  box-sizing: border-box;
}

/* 图片预览区域 */
.image-preview-section {
  margin-bottom: 20px;
}

.image-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}

.image-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.2s ease;
  background: #f8f9fa;
  border: 1px solid #e9ecef;
}

.image-item:active {
  transform: scale(0.98);
}

.preview-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.image-item:active .image-overlay {
  opacity: 1;
}

.preview-icon {
  font-size: 20px;
  color: white;
}

/* 文本内容区域 */
.text-content {
  margin-top: 16px;
}

.content-text {
  font-size: 15px;
  line-height: 1.6;
  color: #2c3e50;
  word-wrap: break-word;
  word-break: break-word;
  overflow-wrap: break-word;
  max-width: 100%;
  box-sizing: border-box;
}

/* 确保rich-text内容不会溢出 */
.content-text rich-text {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow-wrap: break-word;
  word-wrap: break-word;
}

.content-text p {
  margin: 12px 0;
  line-height: 1.7;
  word-wrap: break-word;
  overflow-wrap: break-word;
  max-width: 100%;
}

.content-text h1,
.content-text h2,
.content-text h3,
.content-text h4,
.content-text h5,
.content-text h6 {
  margin: 20px 0 12px 0;
  font-weight: 600;
  color: #1a1a1a;
  line-height: 1.4;
  word-wrap: break-word;
  overflow-wrap: break-word;
  max-width: 100%;
}

.content-text h1 { font-size: 24px; }
.content-text h2 { font-size: 22px; }
.content-text h3 { font-size: 20px; }
.content-text h4 { font-size: 18px; }
.content-text h5 { font-size: 16px; }
.content-text h6 { font-size: 16px; }

.content-text ul,
.content-text ol {
  margin: 12px 0;
  padding-left: 24px;
  word-wrap: break-word;
  overflow-wrap: break-word;
  max-width: 100%;
}

.content-text li {
  margin: 6px 0;
  line-height: 1.6;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.content-text a {
  color: #007aff;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.content-text a:active {
  border-bottom-color: #007aff;
}

.content-text strong,
.content-text b {
  font-weight: 600;
  color: #1a1a1a;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.content-text em,
.content-text i {
  font-style: italic;
  color: #495057;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.content-text code {
  background: #f8f9fa;
  padding: 3px 8px;
  border-radius: 6px;
  font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', monospace;
  font-size: 14px;
  color: #e83e8c;
  border: 1px solid #e9ecef;
  word-wrap: break-word;
  overflow-wrap: break-word;
  max-width: 100%;
}

.content-text blockquote {
  border-left: 4px solid #007aff;
  margin: 16px 0;
  padding: 12px 20px;
  background: #f8f9fa;
  color: #495057;
  font-style: italic;
  border-radius: 0 8px 8px 0;
  word-wrap: break-word;
  overflow-wrap: break-word;
  max-width: 100%;
}

/* 图片样式优化 */
.content-text img {
  max-width: 100% !important;
  height: auto !important;
  border-radius: 8px;
  margin: 8px 0;
  cursor: pointer;
  transition: opacity 0.2s ease;
  box-sizing: border-box;
}

.content-text img:active {
  opacity: 0.8;
}

/* 滚动条样式 */
.modal-content::-webkit-scrollbar {
  width: 6px;
}

.modal-content::-webkit-scrollbar-track {
  background: transparent;
}

.modal-content::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 3px;
}

.modal-content::-webkit-scrollbar-thumb:active {
  background: #9ca3af;
}

/* 移动端优化 */
@media (max-width: 768px) {
  .modal-content::-webkit-scrollbar {
    width: 4px;
  }
  
  .modal-content::-webkit-scrollbar-thumb {
    background: #e5e7eb;
  }
  
  .modal-header {
    padding: 16px 16px 12px;
  }
  
  .modal-title {
    font-size: 16px;
  }
  
  .modal-content {
    padding: 12px 16px;
    max-height: 60vh;
  }
  
  .content-text {
    font-size: 14px;
  }
  
  .image-grid {
    gap: 6px;
  }
}

/* 小屏幕设备优化 */
@media (max-width: 375px) {
  .modal-header {
    padding: 12px 12px 8px;
  }
  
  .modal-title {
    font-size: 15px;
  }
  
  .modal-content {
    padding: 8px 12px;
    max-height: 55vh;
  }
  
  .content-text {
    font-size: 13px;
  }
  
  .image-grid {
    gap: 4px;
  }
} 